# HuskarUI CMake 配置文件
# 此文件由 HuskarUI 库自动生成，用于在 CMake 项目中查找和使用 HuskarUI 库

@PACKAGE_INIT@

# 设置并检查库的包含目录
set_and_check(HuskarUI_INCLUDE_DIR "@PACKAGE_INCLUDE_INSTALL_DIR@")

# 设置并检查库的库目录
set_and_check(HuskarUI_LIBRARY_DIR "@PACKAGE_LIB_INSTALL_DIR@")

# 设置并检查 QML 导入目录
set_and_check(HuskarUI_QML_IMPORT_PATH "@PACKAGE_QML_INSTALL_DIR@")

# 导入目标文件
include("${CMAKE_CURRENT_LIST_DIR}/HuskarUITargets.cmake")

# 检查必要的依赖
include(CMakeFindDependencyMacro)
find_dependency(Qt6 REQUIRED COMPONENTS Core Quick QuickTemplates2)

# 设置QML引擎的导入路径
if(DEFINED QML_IMPORT_PATH)
    list(FIND QML_IMPORT_PATH "${HuskarUI_QML_IMPORT_PATH}" _found_index)
    if(_found_index EQUAL -1)
        list(APPEND QML_IMPORT_PATH "${HuskarUI_QML_IMPORT_PATH}")
        set(QML_IMPORT_PATH "${QML_IMPORT_PATH}" CACHE PATH "QML import path" FORCE)
    endif()
else()
    set(QML_IMPORT_PATH "${HuskarUI_QML_IMPORT_PATH}" CACHE PATH "QML import path")
endif()
